#include "VAuthentication.h"

VAuthentication* VAuthentication::singleton = 0;

VAuthentication::VAuthentication()
{
    this->setFixedSize(600, 600);

    this->text = new QTextEdit;
    this->text->setReadOnly(true);

    this->layoutp = new QVBoxLayout;
    this->layoutp->addWidget(this->text);

    this->setLayout(this->layoutp);
}

VAuthentication::~VAuthentication()
{
    delete text;
    delete layoutp;
}

VAuthentication* VAuthentication::get_instance()
{
    if(!singleton)
        singleton = new VAuthentication;

    return singleton;
}

void VAuthentication::addLine(QString message, QString color)
{
    this->text->setText(this->text->toHtml() + QDateTime::currentDateTime().toString("[dd/MM/yy hh:mm:ss] - ")+"<span style='color : " + color + "'>" + message + "</span>");
}
